﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TypeWrite.MVC4.Areas.Setup.Models;

namespace TypeWrite.MVC4.Areas.Setup.Controllers
{
    public class InstallController : Controller
    {
        //
        // GET: /Setup/Install/

        public ActionResult Index()
        {
            return View();
        }

        //
        // GET: /Setup/Install/Settings

        public ActionResult Settings()
        {
            return View();
        }

        //
        // POST: /Setup/Install/Settings
        [HttpPost]
        public ActionResult Settings(Settings model)
        {
            if (model != null)
            {
                Core.Settings.Instance.AllowRegistration = model.AllowRegistration;
                Core.Settings.Instance.RequireActivation = model.RequireActivation;
                Core.Settings.Instance.Save();
            }

            return RedirectToAction("Index", "Home", new { area = (object)null });
        }

    }
}
